#coding:utf-8
from django.contrib import admin

# Register your models here.

from .models import *

class ProductsAdmin(admin.ModelAdmin):
    list_display = ('product_id','product_title', 'product_link','update_date')
    search_fields = ('product_title',)

class SearchAdmin(admin.ModelAdmin):
    list_display = ('keyword','category', 'product_num','status','update_time')
    search_fields = ('keyword',)

class CountryAdmin(admin.ModelAdmin):
    list_display = ('country_name','country_name_cn', 'country_code','search_string')
    search_fields = ('country_name','country_name_cn','country_code','search_string',)

class TransAdmin(admin.ModelAdmin):
    list_display = ('product_id','username','country_name','buyer_leval','star','pub_date')

class ChooseLogisticsAdmin(admin.ModelAdmin):
    list_display = ('order_id','channel_type','channel','logicstics_no','lpNumber','is_submit','isError')


class NoticeAdmin(admin.ModelAdmin):
    list_display = ('title','send_time','link')

    class Media:
        js = (
            '/static/kindeditor-4.1.10/kindeditor-min.js',
            '/static/kindeditor-4.1.10/lang/zh_CN.js',
            '/static/kindeditor-4.1.10/config.js',
        )

class ArticleAdmin(admin.ModelAdmin):
    list_display = ('title','pub_date','category')

    class Media:
        js = (
            '/static/kindeditor-4.1.10/kindeditor-min.js',
            '/static/kindeditor-4.1.10/lang/zh_CN.js',
            '/static/kindeditor-4.1.10/config.js',
        )


admin.site.register(Products,ProductsAdmin)
admin.site.register(SearchWords,SearchAdmin)
admin.site.register(Transaction,TransAdmin)
admin.site.register(Country,CountryAdmin)
admin.site.register(Logistics)
admin.site.register(Notice,NoticeAdmin)
admin.site.register(Message)
admin.site.register(Store)
admin.site.register(Article,ArticleAdmin)
admin.site.register(NewCategory)
admin.site.register(Competitor)
admin.site.register(Category)
admin.site.register(PlatformCategory)
admin.site.register(Configure)
admin.site.register(ProductDeclare)
admin.site.register(TranslateContent)
admin.site.register(StoreInfo)
admin.site.register(OrderMemo)
admin.site.register(OrderDealMark)
admin.site.register(DeliveryInformation)
admin.site.register(ChooseLogistics,ChooseLogisticsAdmin)
admin.site.register(Delivery)
admin.site.register(SendOrder)